<template>
  <el-row style="width: 97%;">
    <el-col :span="24">
      <h2>公益慈善、支出、职能、事项</h2>
    </el-col>
    <el-col :span="24">
      <h3>{{ year }}年度举办公益慈善活动情况</h3>
    </el-col>
    <el-col :span="18" style="margin-bottom: 15px;">
      本年度是否开展活动
      <el-radio-group v-model="isList1">
        <el-radio :label="1">已开展</el-radio>
        <el-radio :label="2">未开展</el-radio>
      </el-radio-group>
    </el-col>
    <el-col :span="6" style="text-align: right;">
      <el-button type="primary" @click="listAdd(1)">新增</el-button>
    </el-col>
    <el-col :span="24" style="margin-bottom: 35px;">
      <el-form :model="publicWelfareList" ref="publicWelfareListRef" style="width:100%;">
        <el-table :header-cell-style="{ background: '#F0F5FA', color: '#333333' }" v-show="isList1 == '1'"
          :data="publicWelfareList" border>
          <el-table-column type="index" label="序号" align="center" width="60" />
          <el-table-column prop="activityName" label="活动名称" align="center" width="180">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].activityName'" :rules="publicWelfareRules.activityName">
                <el-input v-model="scope.row.activityName" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="实施地域" align="center" width="150">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].address'" :rules="publicWelfareRules.address">
                <el-input v-model="scope.row.address" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="endTime" label="结束时间" align="center" width="150">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].endTime'" :rules="publicWelfareRules.endTime">
                <el-date-picker v-model="scope.row.endTime" type="date" value-format="YYYY-MM-DD" placeholder="结束时间">
                </el-date-picker>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="serviceMode" label="服务方式" align="center" width="130">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].serviceMode'" :rules="publicWelfareRules.serviceMode">
                <el-select clearable v-model="scope.row.serviceMode" placeholder="请选择" style="width: 100%;">
                  <el-option v-for="dict in fuWuFsOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
                </el-select>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="serviceField" label="服务领域" align="center" width="130">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].serviceField'" :rules="publicWelfareRules.serviceField">
                <el-select clearable v-model="scope.row.serviceField" placeholder="请选择" style="width: 100%;">
                  <el-option v-for="dict in fuWuLyOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
                </el-select>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="serviceObject" label="服务对象" align="center" width="130">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].serviceObject'" :rules="publicWelfareRules.serviceObject">
                <el-input v-model="scope.row.serviceObject" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="activityIntroduction" label="活动概述" align="center" width="150">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].activityIntroduction'"
                            :rules="publicWelfareRules.activityIntroduction">
                <el-input v-model="scope.row.activityIntroduction" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>

<!--          <el-table-column prop="activityType" label="活动类型" align="center" width="150">-->
<!--            <template #default="scope">-->
<!--              <el-form-item :prop="'[' + scope.$index + '].activityType'" :rules="publicWelfareRules.activityType">-->
<!--                <el-select clearable v-model="scope.row.activityType" placeholder="请选择">-->
<!--                  <el-option v-for="dict in activityTypeOptions" :key="dict.id" :label="dict.name" :value="dict.id" />-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column prop="conductMode" label="进行方式" align="center" width="120">-->
<!--            <template #default="scope">-->
<!--              <el-form-item :prop="'[' + scope.$index + '].conductMode'" :rules="publicWelfareRules.conductMode">-->
<!--                <el-select clearable v-model="scope.row.conductMode" placeholder="请选择" style="width: 100%;">-->
<!--                  <el-option v-for="dict in activityOngoingOptions" :key="dict.id" :label="dict.name"-->
<!--                    :value="dict.id" />-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column prop="expenditureSituation" label="支出情况" align="center" width="130">-->
<!--            <template #default="scope">-->
<!--              <el-form-item :prop="'[' + scope.$index + '].expenditureSituation'"-->
<!--                :rules="publicWelfareRules.expenditureSituation">-->
<!--                <el-input v-model="scope.row.expenditureSituation" placeholder="请输入"></el-input>-->
<!--              </el-form-item>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column prop="feeSituation" label="收费情况" align="center" width="130">-->
<!--            <template #default="scope">-->
<!--              <el-form-item :prop="'[' + scope.$index + '].feeSituation'" :rules="publicWelfareRules.feeSituation">-->
<!--                <el-input v-model="scope.row.feeSituation" placeholder="请输入"></el-input>-->
<!--              </el-form-item>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column prop="startTime" label="开始时间" align="center" width="150">-->
<!--            <template #default="scope">-->
<!--              <el-form-item :prop="'[' + scope.$index + '].startTime'" :rules="publicWelfareRules.startTime">-->
<!--                <el-date-picker v-model="scope.row.startTime" type="date" value-format="YYYY-MM-DD" placeholder="开始时间">-->
<!--                </el-date-picker>-->
<!--              </el-form-item>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column prop="participantsNum" label="参与人数" align="center" width="120">-->
<!--            <template #default="scope">-->
<!--              <el-form-item :prop="'[' + scope.$index + '].participantsNum'"-->
<!--                :rules="publicWelfareRules.participantsNum">-->
<!--                <el-input type="number" v-model="scope.row.participantsNum" placeholder="请输入"></el-input>-->
<!--              </el-form-item>-->
<!--            </template>-->
<!--          </el-table-column>-->
          <el-table-column fixed="right" label="操作" align="center" width="80">
            <template #default="scope">
              <el-button type="text" size="default" @click="listDelete(1, scope.$index)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-form>
    </el-col>
    <el-col :span="24">
      <h3>{{ year }}公益慈善活动支出</h3>
    </el-col>
    <el-col :span="18" style="margin-bottom: 15px;">
      本年度是否开展活动
      <el-radio-group v-model="isList2">
        <el-radio :label="1">有支出</el-radio>
        <el-radio :label="2">无支出</el-radio>
      </el-radio-group>
    </el-col>
    <el-col :span="6" style="text-align: right;">
      <el-button type="primary" @click="listAdd(2)">新增</el-button>
    </el-col>
    <el-col :span="24" style="margin-bottom: 35px;">
      <el-form :model="expenditureList" ref="expenditureListRef" style="width:100%;">
        <el-table :header-cell-style="{ background: '#F0F5FA', color: '#333333' }" v-show="isList2 == '1'"
          size="default" :data="expenditureList" border>
          <el-table-column prop="expenditure" label="当年总支出" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].expenditure'" :rules="expenditureRules.expenditure">
                <el-input type="number" v-model="scope.row.expenditure" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="upYearAssets" label="上年末净资产" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].upYearAssets'" :rules="expenditureRules.upYearAssets">
                <el-input type="number" v-model="scope.row.upYearAssets" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="publicWelfareExpenditure" label="公益支出" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].publicWelfareExpenditure'"
                :rules="expenditureRules.publicWelfareExpenditure">
                <el-input type="number" v-model="scope.row.publicWelfareExpenditure" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="charitableProportion" label="公益慈善事业支出占上年末净资产的比例" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].charitableProportion'"
                :rules="expenditureRules.charitableProportion">
                <el-input type="number" v-model="scope.row.charitableProportion" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="manageExpenditure" label="管理支出" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].manageExpenditure'"
                :rules="expenditureRules.manageExpenditure">
                <el-input type="number" v-model="scope.row.manageExpenditure" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="manageProportion" label="管理费支出占当年总支出的比例" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].manageProportion'"
                :rules="expenditureRules.manageProportion">
                <el-input type="number" v-model="scope.row.manageProportion" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>

          <el-table-column fixed="right" label="操作" align="center" width="80">
            <template #default="scope">
              <el-button type="text" size="default" @click="listDelete(2, scope.$index)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-form>
    </el-col>
    <el-col :span="24">
      <h3>{{ year }}法律法规规章中明确规定的职能</h3>
    </el-col>
    <el-col :span="18" style="margin-bottom: 15px;">
      本年度是否开展活动
      <el-radio-group v-model="isList3">
        <el-radio :label="1">有规定</el-radio>
        <el-radio :label="2">无规定</el-radio>
      </el-radio-group>
    </el-col>
    <el-col :span="6" style="text-align: right;">
      <el-button type="primary" @click="listAdd(3)">新增</el-button>
    </el-col>
    <el-col :span="24" style="margin-bottom: 35px;">
      <el-form :model="transferredList" ref="transferredListRef" style="width:100%;">
        <el-table :header-cell-style="{ background: '#F0F5FA', color: '#333333' }" v-show="isList3 == '1'"
          size="default" :data="transferredList" border>
          <el-table-column prop="basedOn" label="依据" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].basedOn'" :rules="transferredRules.basedOn">
                <el-input v-model="scope.row.basedOn" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="fun" label="职能" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].fun'" :rules="transferredRules.fun">
                <el-input v-model="scope.row.fun" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="relationship" label="实施中与行政机关关系" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].relationship'" :rules="transferredRules.relationship">
                <el-input v-model="scope.row.relationship" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" align="center" width="80">
            <template #default="scope">
              <el-button type="text" size="default" @click="listDelete(3, scope.$index)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-form>
    </el-col>
    <el-col :span="24">
      <h3>{{ year }}行政机关委托授权的事项</h3>
    </el-col>
    <el-col :span="18" style="margin-bottom: 15px;">
      本年度是否开展活动
      <el-radio-group v-model="isList4">
        <el-radio :label="1">有事项</el-radio>
        <el-radio :label="2">无事项</el-radio>
      </el-radio-group>
    </el-col>
    <el-col :span="6" style="text-align: right;">
      <el-button type="primary" @click="listAdd(4)">新增</el-button>
    </el-col>
    <el-col :span="24" style="margin-bottom: 35px;">
      <el-form :model="entrustedList" ref="entrustedListRef" style="width:100%;">
        <el-table :header-cell-style="{ background: '#F0F5FA', color: '#333333' }" :data="entrustedList"
          v-show="isList4 == '1'" size="default" border>
          <el-table-column type="index" label="序号" align="center" width="60" />
          <el-table-column prop="basedOn" label="依据" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].basedOn'" :rules="entrustedRules.basedOn">
                <el-input v-model="scope.row.basedOn" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="matter" label="事项" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].matter'" :rules="entrustedRules.matter">
                <el-input v-model="scope.row.matter" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column prop="relationship" label="实施中与行政机关关系" align="center">
            <template #default="scope">
              <el-form-item :prop="'[' + scope.$index + '].relationship'" :rules="entrustedRules.relationship">
                <el-input v-model="scope.row.relationship" placeholder="请输入"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" align="center" width="80">
            <template #default="scope">
              <el-button type="text" size="default" @click="listDelete(4, scope.$index)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-form>
    </el-col>
  </el-row>
</template>
<script>
import {
  getDictByCode,
  getTableInfoByPage, stSaveEntrusted, stSaveExpenditure, stSaveTransferred, stSaveWelfare
} from '@/views/yearCheck/ykb/st/st'

export default {
  data() {
    return {

      fuWuFsOptions: [{ id: 1, name: '救助灾害' }, { id: 2, name: '救济贫困' }, { id: 3, name: '扶助残疾人' }, { id: 4, name: '扶助某领域困难的社会群体和个人' }, { id: 5, name: '教育' }, { id: 6, name: '科学' }, { id: 7, name: '文化' }],
      fuWuLyOptions: [{ id: 1, name: '资金救助' }, { id: 2, name: '技术' }, { id: 3, name: '信息' }, { id: 4, name: '专家人才' }, { id: 5, name: '培训' }, { id: 6, name: '生产销售' }],
      year: undefined,
      isList1: 2,
      isList2: 2,
      isList3: 2,
      isList4: 2,
      activityOngoingOptions: undefined,
      eventMethodOptions: undefined,
      activityTypeOptions: undefined,
      sexOptions: [{ id: '1', name: '男' }, { id: '2', name: '女' }],
      shiOptions: [{ id: '1', name: '是' }, { id: '2', name: '否' }],

      publicWelfareForm: {
        id: '',//
        organizationBaseId: '1',//社团组织id
        creditCode: localStorage.getItem('creditCode'),//统一社会信用代码
        examineYear: localStorage.getItem('examineYear'),//审查年度
        activityName: '',//活动名称
        address: '',//实施地域
        endTime: '',//($date-time)结束时间
        serviceMode: '',//服务方式
        serviceField: '',//服务领域
        serviceObject: '',//服务对象
        activityIntroduction: '',//活动介绍

        activityType: '',//活动类型
        conductMode: '',//进行方式
        expenditureSituation: '',//支出情况
        feeSituation: '',//收费情况
        participantsNum: '',//参与人数
        startTime: ''//($date-time)开始时间
      },
      expenditureForm: {
        creditCode: localStorage.getItem('creditCode'),//统一社会信用代码
        examineYear: localStorage.getItem('examineYear'),//审查年度
        organizationBaseId: '1',//社团组织id
        id: '',//
        upYearAssets: '',//上年末净资产
        publicWelfareExpenditure: '',//公益支出
        expenditure: '',//当年总支出
        manageExpenditure: '',//管理支出
        charitableProportion: '',//公益慈善事业支出占上年末净资产的比例
        manageProportion: '',//管理费支出占当年总支出的比例


      },
      transferredForm: {
        id: '',//
        organizationBaseId: '1',//社团组织id
        creditCode: localStorage.getItem('creditCode'),//统一社会信用代码
        examineYear: localStorage.getItem('examineYear'),//审查年度
        basedOn: '',//依据
        fun: '',//职能
        relationship: ''//实施中与行政机关关系
      },
      entrustedForm: {
        id: '',
        organizationBaseId: '1',//社团组织id
        creditCode: localStorage.getItem('creditCode'),//统一社会信用代码
        examineYear: localStorage.getItem('examineYear'),//审查年度
        matter: '',//事项
        basedOn: '',//依据
        relationship: ''//实施中与行政机关关系
      },
      //公益慈善活动情况
      publicWelfareList: [],
      //公益活动支出
      expenditureList: [],
      //法律法规 转移得职能
      transferredList: [],
      //行政机关委托的事项
      entrustedList: [],
      publicWelfareRules: {
        activityIntroduction: [{ required: true, message: '请完善', trigger: 'blur' }],
        activityName: [{ required: true, message: '请完善', trigger: 'blur' }],
        activityType: [{ required: true, message: '请完善', trigger: 'blur' }],
        address: [{ required: true, message: '请完善', trigger: 'blur' }],
        conductMode: [{ required: true, message: '请完善', trigger: 'blur' }],
        endTime: [{ required: true, message: '请完善', trigger: 'blur' }],
        expenditureSituation: [{ required: true, message: '请完善', trigger: 'blur' }],
        feeSituation: [{ required: true, message: '请完善', trigger: 'blur' }],
        participantsNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        serviceField: [{ required: true, message: '请完善', trigger: 'blur' }],
        serviceMode: [{ required: true, message: '请完善', trigger: 'blur' }],
        serviceObject: [{ required: true, message: '请完善', trigger: 'blur' }],
        startTime: [{ required: true, message: '请完善', trigger: 'blur' }],
      },
      expenditureRules: {
        expenditure: [{ required: true, message: '请完善', trigger: 'blur' }],
        charitableProportion: [{ required: true, message: '请完善', trigger: 'blur' }],
        manageExpenditure: [{ required: true, message: '请完善', trigger: 'blur' }],
        manageProportion: [{ required: true, message: '请完善', trigger: 'blur' }],
        publicWelfareExpenditure: [{ required: true, message: '请完善', trigger: 'blur' }],
        upYearAssets: [{ required: true, message: '请完善', trigger: 'blur' }],
      },
      transferredRules: {
        basedOn: [{ required: true, message: '请完善', trigger: 'blur' }],
        fun: [{ required: true, message: '请完善', trigger: 'blur' }],
        relationship: [{ required: true, message: '请完善', trigger: 'blur' }],
      },
      entrustedRules: {
        matter: [{ required: true, message: '请完善', trigger: 'blur' }],
        basedOn: [{ required: true, message: '请完善', trigger: 'blur' }],
        relationship: [{ required: true, message: '请完善', trigger: 'blur' }],
      },
    }
  },
  created() {

  },
  methods: {
    listDelete(index, position) {
      if (index == 1) {
        this.expositionList.splice(position, 1)
      } else if (index == 2) {
        this.expenditureList.splice(position, 1)
      } else if (index == 3) {
        this.transferredList.splice(position, 1)
      } else if (index == 4) {
        this.entrustedList.splice(position, 1)
      }
    },
    listAdd(index) {
      if (index == 1) {
        this.publicWelfareList.push({ ...this.publicWelfareForm })
        this.isList1 = 1
      } else if (index == 2) {
        this.expenditureList.push({ ...this.expenditureForm })
        this.isList2 = 1
      } else if (index == 3) {
        this.transferredList.push({ ...this.transferredForm })
        this.isList3 = 1
      } else if (index == 4) {
        this.entrustedList.push({ ...this.entrustedForm })
        this.isList4 = 1
      }
    },
    postInfo() {
      this.$refs.publicWelfareListRef.validate(valid => {
        if (valid) {
          if (this.publicWelfareList == null || this.publicWelfareList.length == 0) {
            return;
          }
          for (let i = 0; i < this.publicWelfareList.length; i++) {
            this.publicWelfareList[i].creditCode = localStorage.getItem("creditCode");
            this.publicWelfareList[i].examineYear = localStorage.getItem("examineYear");
          }
          stSaveWelfare(this.publicWelfareList).then(response => {
            this.$message({
              message: '保存公益慈善活动情况成功！',
              type: 'success'
            })
            this.getInfo();
          })
        } else {
          this.$message({
            message: '请填写完整！',
            type: 'error'
          });
        }
      });
      this.$refs.expenditureListRef.validate(valid => {
        if (valid) {
          if (this.expenditureList == null || this.expenditureList.length == 0) {
            return;
          }
          for (let i = 0; i < this.expenditureList.length; i++) {
            this.expenditureList[i].creditCode = localStorage.getItem("creditCode");
            this.expenditureList[i].examineYear = localStorage.getItem("examineYear");
          }
          stSaveExpenditure(this.expenditureList).then(response => {
            this.$message({
              message: '保存公益活动支出成功',
              type: 'success'
            })
            this.getInfo();
          })
        } else {
          this.$message({
            message: '请填写完整！',
            type: 'error'
          });
        }
      });
      this.$refs.transferredListRef.validate(valid => {
        if (valid) {
          if (this.transferredList == null || this.transferredList.length == 0) {
            return;
          }
          for (let i = 0; i < this.transferredList.length; i++) {
            this.transferredList[i].creditCode = localStorage.getItem("creditCode");
            this.transferredList[i].examineYear = localStorage.getItem("examineYear");
          }
          stSaveTransferred(this.transferredList).then(response => {
            this.$message({
              message: '保存法律法规职能成功',
              type: 'success'
            })
            this.getInfo();
          })
        } else {
          this.$message({
            message: '请填写完整！',
            type: 'error'
          });
        }
      });
      this.$refs.entrustedListRef.validate(valid => {
        if (valid) {
          if (this.entrustedList == null || this.entrustedList.length == 0) {
            return;
          }
          for (let i = 0; i < this.entrustedList.length; i++) {
            this.entrustedList[i].creditCode = localStorage.getItem("creditCode");
            this.entrustedList[i].examineYear = localStorage.getItem("examineYear");
          }
          stSaveEntrusted(this.entrustedList).then(response => {
            this.$message({
              message: '保存行政机关委托的事项成功',
              type: 'success'
            })
            this.getInfo();
          })
        } else {
          this.$message({
            message: '请填写完整！',
            type: 'error'
          });
        }
      });

    },
    getInfo() {
      getDictByCode('activityOngoing').then(response => {
        this.activityOngoingOptions = response.data
      })
      getDictByCode('eventMethod').then(response => {
        this.eventMethodOptions = response.data
      })
      getDictByCode('activityType').then(response => {
        this.activityTypeOptions = response.data
      })
      this.year = localStorage.getItem('examineYear')
      getTableInfoByPage(14).then(response => {
        this.publicWelfareList = response.data.publicWelfareList
        this.expenditureList = response.data.expenditureList
        this.transferredList = response.data.transferredList
        this.entrustedList = response.data.entrustedList
        if (this.publicWelfareList == null || this.publicWelfareList == '') {
          this.publicWelfareList = []
          this.isList1 = 2
        } else {
          this.isList1 = 1
          for (let i = 0; i < this.publicWelfareList.length; i++) {
            if(this.publicWelfareList[i].serviceMode != null && this.publicWelfareList[i].serviceMode != ''){
              this.publicWelfareList[i].serviceMode = Number(this.publicWelfareList[i].serviceMode)
            }
            if(this.publicWelfareList[i].serviceField != null && this.publicWelfareList[i].serviceField != ''){
              this.publicWelfareList[i].serviceField = Number(this.publicWelfareList[i].serviceField)
            }
          }
        }
        if (this.expenditureList == null || this.expenditureList == '') {
          this.expenditureList = []
          this.isList2 = 2
        } else {
          this.isList2 = 1
        }
        if (this.transferredList == null || this.transferredList == '') {
          this.transferredList = []
          this.isList3 = 2
        } else {
          this.isList3 = 1
        }
        if (this.entrustedList == null || this.entrustedList == '') {
          this.entrustedList = []
          this.isList4 = 2
        } else {
          this.isList4 = 1
        }
      })
    }
  }
}
</script>
<style scoped lang="scss">
.el-table {
  --el-table-row-hover-bg-color: rgba(39, 137, 238, 0.1);
  --el-table-border-color: #e0e5f0;
}

:deep(.el-card.is-always-shadow) {
  box-shadow: 0 1px 14px 0 rgba(209, 224, 239, 0.6)
}

/* 拉框选中 */
.el-select-dropdown__item {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

/* 鼠标经过下拉框 */
.el-select-dropdown__item:hover {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

.el-select-dropdown__item.selected {
  color: #2789EE;
}

.app-container {
  margin-top: 40px;
  margin-left: 15%;
  width: 70%;
}

.div-bg {
  width: 100%;
  background: #F0F0F0;
  height: 10px;
}

.box-card {
  width: 100%;
  margin-top: 20px;
  padding: 20px;
}

.el-col {
  padding-left: 5px;
}

.divider-title {
  font-weight: bold;
  font-size: 18px;
}

.custom-select .el-select-dropdown {
  max-height: 600px;
  /* 设置为你想要的高度 */
  overflow: auto;
  /* 添加滚动条 */
}

table {
  border-collapse: collapse;
  /* 确保表格的边框合并为单一边框 */
  width: 100%;
  /* 表格宽度 */
}

td {
  border: 1px solid #ababab;
  /* 设置单线边框 */
  padding: 6px;
  /* 单元格内边距 */
}

.el-form-item {
  margin-bottom: 0px;
}
</style>
